/**
 * 存储sessionStorage
 */
export const setStore = (name, content) => {
  if (!name) return;
  if (typeof content !== 'string') {
    content = JSON.stringify(content);
  }
  window.sessionStorage.setItem(name, content);
}

/**
 * 获取sessionStorage
 */
export const getStore = name => {
  if (!name) return;
  return window.sessionStorage.getItem(name);
}

/**
 * 删除sessionStorage
 */
export const removeStore = name => {
  if (!name) return;
  window.sessionStorage.removeItem(name);
}

/**
 * 删除所有sessionStorage
 */
export const removeAllStore = () => {
  window.sessionStorage.clear();
}

export const transferTime = date => {
  if (date == "" || date == null) {
    return;
  } else {
    var dataee = new Date(date).toJSON();
    var times = new Date(+new Date(dataee) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '');
    return times;
  }
}



